/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

// 买马状态
exports.MaStatus = {

    'ZM_BuyMA' : 11,
    'ZM_Buy147MA' : 12,
    'LDZM_BuyMA' : 21,
    'LDZM_Buy147MA' : 22
};

// 定漂状态
exports.PiaoStatus = {

    'None' : 0,
    'Wait' : 1,
    'Finish' : 2
};

// 默认翻出的牌数
exports.gameSetting = {
    "MaNum" : 5
};

// 胡牌番数
var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.GSG = 109;

var Pattern = {
    'NONE': 0,                       // 不是可胡的牌型
    'NORMAL': 1,     // 平胡1
    'PAIR7': 3,       // 七对3
    'PPH': 4,        // 碰碰胡4
    'HHPAIR7': 5,                    // 豪华七对
    'KAWUXING' : 6,                  // 卡五星
    'MINGSIGUI' : 7,                 // 明四归
    'ANSIGUI'  : 8,                  // 暗四归
    'SHOUZHUAYI' : 9,                // 手抓一
    'XIAOSANYUAN' : 10,              // 小三元
    'DASANYUAN' :  11,               // 大三元
    'QINGYISE' : 12,                 // 清一色
    'QINGPAIR7': 13,                 // 清一色七对
    'QINGPPH'  : 14,                 // 清一色碰碰胡
    'QINGSHOUZHUAYI' : 15,           // 清一色手抓一
    'QINGHHPAIR7' : 16,              // 清一色豪华七对
    'QINGKAWUXING' : 17,             // 清一色卡五星
    'QINGMINGSIGUI' : 18,            // 清一色明四归
    'QINGANSIGUI' : 19               // 清一色暗四归
};

var PatternScore = {};
PatternScore[Pattern.NONE] = 0;
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.PAIR] = 2;
PatternScore[Pattern.PAIR7] = 4;
PatternScore[Pattern.PPH] = 2;
PatternScore[Pattern.HHPAIR7] = 8;
PatternScore[Pattern.KAWUXING] = 2;
PatternScore[Pattern.MINGSIGUI] = 2;
PatternScore[Pattern.ANSIGUI] = 4;
PatternScore[Pattern.SHOUZHUAYI] = 4;
PatternScore[Pattern.XIAOSANYUAN] = 4;
PatternScore[Pattern.DASANYUAN] = 8;
PatternScore[Pattern.QINGYISE] = 4;
PatternScore[Pattern.QINGPAIR7] = 8;
PatternScore[Pattern.QINGPPH] = 8;
PatternScore[Pattern.QINGSHOUZHUAYI] = 8;
PatternScore[Pattern.QINGHHPAIR7] = 8;
PatternScore[Pattern.QINGKAWUXING] = 8;
PatternScore[Pattern.QINGMINGSIGUI] = 8;
PatternScore[Pattern.QINGANSIGUI] = 8;

var ItemScore = {};
ItemScore[ScoreRule.DH] = 0;
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.LZ] = 0;
ItemScore[ScoreRule.GSH] = 2;
ItemScore[ScoreRule.GSP] = 2;
ItemScore[ScoreRule.QG] = 2;
ItemScore[ScoreRule.BT] = 2;
ItemScore[ScoreRule.TH] = 0;
ItemScore[ScoreRule.DIHU] = 0;
ItemScore[ScoreRule.TT] = 0;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    PIAO: 301,         // 飘
    //SIBAO:11,
    BT: ScoreRule.BT   // 报听 (亮倒)
    //LZ: ScoreRule.LZ, // 庄家
    //QG: ScoreRule.QG, // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 2;
GangScore[MJ.Gang.DIAN] = 2;
GangScore[MJ.Gang.ANS] = 2;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;

//exports.SpecGang = SpecGang;
//exports.SpecGangScore = SpecGangScore;